# -*- coding: utf-8 -*-
# @version : 1.0
# @File    : m2m.py
# @Date    : 2024/9/13 14:15
# @Author  : GlenZhao
# @Desc    : 关联中间表

from db.base import Base
from sqlalchemy import ForeignKey, Column, Table, Integer, UniqueConstraint


auth_user_roles = Table(
    "auth_user_roles",
    Base.metadata,
    Column("user_id", Integer, ForeignKey("auth_user.id", ondelete="CASCADE")),
    Column("role_id", Integer, ForeignKey("auth_role.id", ondelete="CASCADE")),
    UniqueConstraint("user_id", "role_id", name="unique_user_role")
)
